\(\int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx\) [158]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (warning: unable to verify)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 83 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {a \sqrt {-1+d x} \sqrt {1+d x}}{2 x^2}+\frac {b \sqrt {-1+d x} \sqrt {1+d x}}{x}+\frac {1}{2} \left (2 c+a d^2\right ) \arctan \left (\sqrt {-1+d x} \sqrt {1+d x}\right ) \]

[Out]

1/2*(a*d^2+2*c)*arctan((d*x-1)^(1/2)*(d*x+1)^(1/2))+1/2*a*(d*x-1)^(1/2)*(d*x+1)^(1/2)/x^2+b*(d*x-1)^(1/2)*(d*x
+1)^(1/2)/x

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.55, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {1624, 1821, 821, 272, 65, 211} \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {\sqrt {d^2 x^2-1} \left (a d^2+2 c\right ) \arctan \left (\sqrt {d^2 x^2-1}\right )}{2 \sqrt {d x-1} \sqrt {d x+1}}-\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {d x-1} \sqrt {d x+1}}-\frac {b \left (1-d^2 x^2\right )}{x \sqrt {d x-1} \sqrt {d x+1}} \]

[In]

Int[(a + b*x + c*x^2)/(x^3*Sqrt[-1 + d*x]*Sqrt[1 + d*x]),x]

[Out]

-1/2*(a*(1 - d^2*x^2))/(x^2*Sqrt[-1 + d*x]*Sqrt[1 + d*x]) - (b*(1 - d^2*x^2))/(x*Sqrt[-1 + d*x]*Sqrt[1 + d*x])
 + ((2*c + a*d^2)*Sqrt[-1 + d^2*x^2]*ArcTan[Sqrt[-1 + d^2*x^2]])/(2*Sqrt[-1 + d*x]*Sqrt[1 + d*x])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 821

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(-(e*f - d*g
))*(d + e*x)^(m + 1)*((a + c*x^2)^(p + 1)/(2*(p + 1)*(c*d^2 + a*e^2))), x] + Dist[(c*d*f + a*e*g)/(c*d^2 + a*e
^2), Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0
] && EqQ[Simplify[m + 2*p + 3], 0]

Rule 1624

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Dist[(a
 + b*x)^FracPart[m]*((c + d*x)^FracPart[m]/(a*c + b*d*x^2)^FracPart[m]), Int[Px*(a*c + b*d*x^2)^m*(e + f*x)^p,
 x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && PolyQ[Px, x] && EqQ[b*c + a*d, 0] && EqQ[m, n] &&  !Intege
rQ[m]

Rule 1821

Int[(Pq_)*((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, c*x, x],
 R = PolynomialRemainder[Pq, c*x, x]}, Simp[R*(c*x)^(m + 1)*((a + b*x^2)^(p + 1)/(a*c*(m + 1))), x] + Dist[1/(
a*c*(m + 1)), Int[(c*x)^(m + 1)*(a + b*x^2)^p*ExpandToSum[a*c*(m + 1)*Q - b*R*(m + 2*p + 3)*x, x], x], x]] /;
FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] && LtQ[m, -1] && (IntegerQ[2*p] || NeQ[Expon[Pq, x], 1])

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {-1+d^2 x^2} \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d^2 x^2}} \, dx}{\sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\sqrt {-1+d^2 x^2} \int \frac {2 b+\left (2 c+a d^2\right ) x}{x^2 \sqrt {-1+d^2 x^2}} \, dx}{2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {b \left (1-d^2 x^2\right )}{x \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (\left (2 c+a d^2\right ) \sqrt {-1+d^2 x^2}\right ) \int \frac {1}{x \sqrt {-1+d^2 x^2}} \, dx}{2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {b \left (1-d^2 x^2\right )}{x \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (\left (2 c+a d^2\right ) \sqrt {-1+d^2 x^2}\right ) \text {Subst}\left (\int \frac {1}{x \sqrt {-1+d^2 x}} \, dx,x,x^2\right )}{4 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {b \left (1-d^2 x^2\right )}{x \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (\left (2 c+a d^2\right ) \sqrt {-1+d^2 x^2}\right ) \text {Subst}\left (\int \frac {1}{\frac {1}{d^2}+\frac {x^2}{d^2}} \, dx,x,\sqrt {-1+d^2 x^2}\right )}{2 d^2 \sqrt {-1+d x} \sqrt {1+d x}} \\ & = -\frac {a \left (1-d^2 x^2\right )}{2 x^2 \sqrt {-1+d x} \sqrt {1+d x}}-\frac {b \left (1-d^2 x^2\right )}{x \sqrt {-1+d x} \sqrt {1+d x}}+\frac {\left (2 c+a d^2\right ) \sqrt {-1+d^2 x^2} \tan ^{-1}\left (\sqrt {-1+d^2 x^2}\right )}{2 \sqrt {-1+d x} \sqrt {1+d x}} \\ \end{align*}

Mathematica [A] (warning: unable to verify)

Time = 0.13 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.72 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {(a+2 b x) \sqrt {-1+d x} \sqrt {1+d x}}{2 x^2}+\left (2 c+a d^2\right ) \arctan \left (\sqrt {\frac {-1+d x}{1+d x}}\right ) \]

[In]

Integrate[(a + b*x + c*x^2)/(x^3*Sqrt[-1 + d*x]*Sqrt[1 + d*x]),x]

[Out]

((a + 2*b*x)*Sqrt[-1 + d*x]*Sqrt[1 + d*x])/(2*x^2) + (2*c + a*d^2)*ArcTan[Sqrt[(-1 + d*x)/(1 + d*x)]]

Maple [A] (verified)

Time = 1.63 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.92

method result size
risch \(\frac {\sqrt {d x +1}\, \sqrt {d x -1}\, \left (2 b x +a \right )}{2 x^{2}}-\frac {\left (c +\frac {a \,d^{2}}{2}\right ) \arctan \left (\frac {1}{\sqrt {d^{2} x^{2}-1}}\right ) \sqrt {\left (d x +1\right ) \left (d x -1\right )}}{\sqrt {d x -1}\, \sqrt {d x +1}}\) \(76\)
default \(-\frac {\sqrt {d x -1}\, \sqrt {d x +1}\, \operatorname {csgn}\left (d \right )^{2} \left (\arctan \left (\frac {1}{\sqrt {d^{2} x^{2}-1}}\right ) a \,d^{2} x^{2}+2 \arctan \left (\frac {1}{\sqrt {d^{2} x^{2}-1}}\right ) c \,x^{2}-2 \sqrt {d^{2} x^{2}-1}\, b x -\sqrt {d^{2} x^{2}-1}\, a \right )}{2 \sqrt {d^{2} x^{2}-1}\, x^{2}}\) \(103\)

[In]

int((c*x^2+b*x+a)/x^3/(d*x-1)^(1/2)/(d*x+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*(d*x+1)^(1/2)*(d*x-1)^(1/2)*(2*b*x+a)/x^2-(c+1/2*a*d^2)*arctan(1/(d^2*x^2-1)^(1/2))*((d*x+1)*(d*x-1))^(1/2
)/(d*x-1)^(1/2)/(d*x+1)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.83 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {2 \, b d x^{2} + 2 \, {\left (a d^{2} + 2 \, c\right )} x^{2} \arctan \left (-d x + \sqrt {d x + 1} \sqrt {d x - 1}\right ) + {\left (2 \, b x + a\right )} \sqrt {d x + 1} \sqrt {d x - 1}}{2 \, x^{2}} \]

[In]

integrate((c*x^2+b*x+a)/x^3/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="fricas")

[Out]

1/2*(2*b*d*x^2 + 2*(a*d^2 + 2*c)*x^2*arctan(-d*x + sqrt(d*x + 1)*sqrt(d*x - 1)) + (2*b*x + a)*sqrt(d*x + 1)*sq
rt(d*x - 1))/x^2

Sympy [F(-1)]

Timed out. \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\text {Timed out} \]

[In]

integrate((c*x**2+b*x+a)/x**3/(d*x-1)**(1/2)/(d*x+1)**(1/2),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.73 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=-\frac {1}{2} \, a d^{2} \arcsin \left (\frac {1}{d {\left | x \right |}}\right ) - c \arcsin \left (\frac {1}{d {\left | x \right |}}\right ) + \frac {\sqrt {d^{2} x^{2} - 1} b}{x} + \frac {\sqrt {d^{2} x^{2} - 1} a}{2 \, x^{2}} \]

[In]

integrate((c*x^2+b*x+a)/x^3/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="maxima")

[Out]

-1/2*a*d^2*arcsin(1/(d*abs(x))) - c*arcsin(1/(d*abs(x))) + sqrt(d^2*x^2 - 1)*b/x + 1/2*sqrt(d^2*x^2 - 1)*a/x^2

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 145 vs. \(2 (67) = 134\).

Time = 0.31 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.75 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=-\frac {{\left (a d^{3} + 2 \, c d\right )} \arctan \left (\frac {1}{2} \, {\left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}^{2}\right ) + \frac {2 \, {\left (a d^{3} {\left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}^{6} - 4 \, b d^{2} {\left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}^{4} - 4 \, a d^{3} {\left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}^{2} - 16 \, b d^{2}\right )}}{{\left ({\left (\sqrt {d x + 1} - \sqrt {d x - 1}\right )}^{4} + 4\right )}^{2}}}{d} \]

[In]

integrate((c*x^2+b*x+a)/x^3/(d*x-1)^(1/2)/(d*x+1)^(1/2),x, algorithm="giac")

[Out]

-((a*d^3 + 2*c*d)*arctan(1/2*(sqrt(d*x + 1) - sqrt(d*x - 1))^2) + 2*(a*d^3*(sqrt(d*x + 1) - sqrt(d*x - 1))^6 -
 4*b*d^2*(sqrt(d*x + 1) - sqrt(d*x - 1))^4 - 4*a*d^3*(sqrt(d*x + 1) - sqrt(d*x - 1))^2 - 16*b*d^2)/((sqrt(d*x
+ 1) - sqrt(d*x - 1))^4 + 4)^2)/d

Mupad [B] (verification not implemented)

Time = 10.45 (sec) , antiderivative size = 316, normalized size of antiderivative = 3.81 \[ \int \frac {a+b x+c x^2}{x^3 \sqrt {-1+d x} \sqrt {1+d x}} \, dx=\frac {\frac {a\,d^2\,1{}\mathrm {i}}{32}+\frac {a\,d^2\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2\,1{}\mathrm {i}}{16\,{\left (\sqrt {d\,x+1}-1\right )}^2}-\frac {a\,d^2\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^4\,15{}\mathrm {i}}{32\,{\left (\sqrt {d\,x+1}-1\right )}^4}}{\frac {{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {d\,x+1}-1\right )}^2}+\frac {2\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^4}{{\left (\sqrt {d\,x+1}-1\right )}^4}+\frac {{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^6}{{\left (\sqrt {d\,x+1}-1\right )}^6}}-c\,\left (\ln \left (\frac {{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {d\,x+1}-1\right )}^2}+1\right )-\ln \left (\frac {\sqrt {d\,x-1}-\mathrm {i}}{\sqrt {d\,x+1}-1}\right )\right )\,1{}\mathrm {i}-\frac {a\,d^2\,\ln \left (\frac {{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {d\,x+1}-1\right )}^2}+1\right )\,1{}\mathrm {i}}{2}+\frac {a\,d^2\,\ln \left (\frac {\sqrt {d\,x-1}-\mathrm {i}}{\sqrt {d\,x+1}-1}\right )\,1{}\mathrm {i}}{2}+\frac {b\,\sqrt {d\,x-1}\,\sqrt {d\,x+1}}{x}+\frac {a\,d^2\,{\left (\sqrt {d\,x-1}-\mathrm {i}\right )}^2\,1{}\mathrm {i}}{32\,{\left (\sqrt {d\,x+1}-1\right )}^2} \]

[In]

int((a + b*x + c*x^2)/(x^3*(d*x - 1)^(1/2)*(d*x + 1)^(1/2)),x)

[Out]

((a*d^2*1i)/32 + (a*d^2*((d*x - 1)^(1/2) - 1i)^2*1i)/(16*((d*x + 1)^(1/2) - 1)^2) - (a*d^2*((d*x - 1)^(1/2) -
1i)^4*15i)/(32*((d*x + 1)^(1/2) - 1)^4))/(((d*x - 1)^(1/2) - 1i)^2/((d*x + 1)^(1/2) - 1)^2 + (2*((d*x - 1)^(1/
2) - 1i)^4)/((d*x + 1)^(1/2) - 1)^4 + ((d*x - 1)^(1/2) - 1i)^6/((d*x + 1)^(1/2) - 1)^6) - c*(log(((d*x - 1)^(1
/2) - 1i)^2/((d*x + 1)^(1/2) - 1)^2 + 1) - log(((d*x - 1)^(1/2) - 1i)/((d*x + 1)^(1/2) - 1)))*1i - (a*d^2*log(
((d*x - 1)^(1/2) - 1i)^2/((d*x + 1)^(1/2) - 1)^2 + 1)*1i)/2 + (a*d^2*log(((d*x - 1)^(1/2) - 1i)/((d*x + 1)^(1/
2) - 1))*1i)/2 + (b*(d*x - 1)^(1/2)*(d*x + 1)^(1/2))/x + (a*d^2*((d*x - 1)^(1/2) - 1i)^2*1i)/(32*((d*x + 1)^(1
/2) - 1)^2)